////商品
class GoodsDetail{
  String goods_id;
  String category_id;
  String name;
  String title;
  String content;
  String cost_price;
  String old_price;
  String sell_price;
  String goods_pv;
  String hits;
  dynamic sales_volume;
  dynamic is_top;
  dynamic is_hot;
  dynamic is_rec;
  dynamic is_super;
  dynamic is_adopt;
  dynamic sort;
  String create_time;
  String category_name;
  dynamic stock;
  String img_url;
  List<ProductSkuNewModel> spec;
  List<ProductImage> imgs;
  dynamic bean_sell_price;
  String shopping_value;
  dynamic merchant_type;
  dynamic goods_type;
  dynamic fees;
  String avg_price;
  String game_points;
  dynamic feesWatio;
  GoodsDetail({this.goods_id,this.category_id,this.name,this.title,this.content,this.cost_price,this.old_price,
    this.sell_price,this.goods_pv,this.hits,this.sales_volume,this.is_top,this.is_hot,this.is_rec,this.is_super,
    this.is_adopt,this.sort,this.create_time,this.category_name,this.stock,this.img_url,this.spec,this.imgs,
    this.bean_sell_price,this.shopping_value,this.merchant_type,this.goods_type,this.fees,this.avg_price,this.game_points,this.feesWatio});
  GoodsDetail.fromJson(Map<String, dynamic> json) {
    goods_id = json['goods_id'];
    category_id = json['category_id'];
    name = json['name'];
    title = json['title'];
    content = json['content'];
    cost_price = json['cost_price'];
    old_price = json['old_price'];
    sell_price = json['sell_price'];
    goods_pv = json['goods_pv'];
    hits = json['hits'];
    sales_volume = json['sales_volume'];
    is_top = json['is_top'];
    is_hot = json['is_hot'];
    is_rec = json['is_rec'];
    is_super = json['is_super'];
    is_adopt = json['is_adopt'];
    sort = json['sort'];
    create_time = json['create_time'];
    category_name = json['category_name'];
    stock = json['stock'];
    img_url = json['img_url'];
    dynamic specJson = json['spec'];
    if (specJson != null && specJson is List) {
      spec = specJson.map((e) => ProductSkuNewModel.fromJson(e)).toList();
    }
    dynamic imgsJson = json['imgs'];
    if (imgsJson != null && imgsJson is List) {
      imgs = imgsJson.map((e) => ProductImage.fromJson(e)).toList();
    }
    bean_sell_price = json['bean_sell_price'];
    shopping_value = json['shopping_value'];
    merchant_type = json['merchant_type'];
    goods_type = json['goods_type'];
    fees = json['fees'];
    avg_price = json['avg_price'];
    game_points = json['game_points'];
    feesWatio = json['feesWatio'];
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['goods_id'] = this.goods_id;
    data['category_id'] = this.category_id;
    data['name'] = this.name;
    data['title'] = this.title;
    data['content'] = this.content;
    data['cost_price'] = this.cost_price;
    data['old_price'] = this.old_price;
    data['sell_price'] = this.sell_price;
    data['goods_pv'] = this.goods_pv;
    data['hits'] = this.hits;
    data['sales_volume'] = this.sales_volume;
    data['is_top'] = this.is_top;
    data['is_hot'] = this.is_hot;
    data['is_rec'] = this.is_rec;
    data['is_super'] = this.is_super;
    data['is_adopt'] = this.is_adopt;
    data['sort'] = this.sort;
    data['create_time'] = this.create_time;
    data['category_name'] = this.category_name;
    data['stock'] = this.stock;
    data['img_url'] = this.img_url;
    if (this.spec != null) {
      data['spec'] = this.spec.map((v) => v.toJson()).toList();
    }
    if (this.imgs != null) {
      data['imgs'] = this.imgs.map((v) => v.toJson()).toList();
    }
    data['bean_sell_price'] = this.bean_sell_price;
    data['shopping_value'] = this.shopping_value;
    data['merchant_type'] = this.merchant_type;
    data['goods_type'] = this.goods_type;
    data['fees'] = this.fees;
    data['avg_price'] = this.avg_price;
    data['game_points'] = this.game_points;
    data['feesWatio'] = this.feesWatio;
    return data;
  }
}


class ProductImage{
  String file_url;
  ProductImage({this.file_url});
  ProductImage.fromJson(Map<String, dynamic> json) {
    file_url = json['file_url'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['file_url'] = this.file_url;
    return data;
  }
}
class ProductSkuNewModel {
  dynamic spec_id;
  dynamic spec_pid;
  List<SpecDetailNewModel> children;
  String name;
  ProductSkuNewModel({this.spec_id, this.spec_pid, this.children,this.name});
  ProductSkuNewModel.fromJson(Map<String, dynamic> json) {
    spec_id = json['spec_id'];
    spec_pid = json['spec_pid'];
    if (json['children'] != null) {
      children = [];
      json['children'].forEach((v) {
        children.add(SpecDetailNewModel.fromJson(v));
      });
    }
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['spec_id'] = this.spec_id;
    data['spec_pid'] = this.spec_pid;
    if (this.children != null) {
      data['children'] = this.children.map((v) => v.toJson()).toList();
    }
    data['name'] = this.name;
    return data;
  }
}

class SpecDetailNewModel {
  dynamic spec_id;
  dynamic spec_pid;
  String name;

  SpecDetailNewModel({this.spec_id, this.spec_pid, this.name});

  SpecDetailNewModel.fromJson(Map<String, dynamic> json) {
    spec_id = json['spec_id'];
    spec_pid = json['spec_pid'];
    name = json['name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['spec_id'] = this.spec_id;
    data['spec_pid'] = this.spec_pid;
    data['name'] = this.name;
    return data;
  }
}


class NewProductSkuModel{
  String sku_id;
  String goods_id;
  String sku_code;
  String sku_name;
  dynamic sku_stock;
  String sku_old_price;
  String sku_sell_price;
  String sku_img_url;
  dynamic sku_bean_sell_price;
  String sku_shopping_value;
  dynamic fees;
  String avg_price;
  String sku_game_points;
  String spec_name;
  String sku_linglong_price;
  NewProductSkuModel({this.sku_id,this.goods_id,this.sku_code,this.sku_name,this.sku_stock,this.sku_old_price,
    this.sku_sell_price,this.sku_img_url,this.sku_bean_sell_price,this.sku_shopping_value,this.fees,this.avg_price,this.sku_game_points,this.spec_name,this.sku_linglong_price});
  NewProductSkuModel.fromJson(Map<String, dynamic> json) {
    sku_id = json['sku_id'];
    goods_id = json['goods_id'];
    sku_code = json['sku_code'];
    sku_name = json['sku_name'];
    sku_stock = json['sku_stock'];
    sku_old_price = json['sku_old_price'];
    sku_sell_price = json['sku_sell_price'];
    sku_img_url = json['sku_img_url'];
    sku_bean_sell_price = json['sku_bean_sell_price'];
    sku_shopping_value = json['sku_shopping_value'];
    fees = json['fees'];
    avg_price = json['avg_price'];
    sku_game_points = json['sku_game_points'];
    spec_name = json['spec_name'];
    sku_linglong_price = json['sku_linglong_price'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = Map<String, dynamic>();
    data['sku_id'] = this.sku_id;
    data['goods_id'] = this.goods_id;
    data['sku_code'] = this.sku_code;
    data['sku_name'] = this.sku_name;
    data['sku_stock'] = this.sku_stock;
    data['sku_old_price'] = this.sku_old_price;
    data['sku_sell_price'] = this.sku_sell_price;
    data['sku_img_url'] = this.sku_img_url;
    data['sku_bean_sell_price'] = this.sku_bean_sell_price;
    data['sku_shopping_value'] = this.sku_shopping_value;
    data['fees'] = this.fees;
    data['avg_price'] = this.avg_price;
    data['sku_game_points'] = this.sku_game_points;
    data['spec_name'] = this.spec_name;
    data['sku_linglong_price'] = this.sku_linglong_price;
    return data;
  }
}
